package com.ruoyi.business.common.riskRule;

import com.ruoyi.business.Vo.RulePremiseVo;
import com.ruoyi.business.service.impl.RaiseLimitServiceImpl;
import com.ruoyi.common.utils.spring.SpringUtils;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
@AllArgsConstructor
public class ReplenishInfo implements RuleStrategy {


    @Override
    public String getType() {
        return REPLENISH;
    }

    @Override
    public int applyInfoExpire(String fingerprint, String custNo,String excludeSerialNo) {
        return 0;
    }

    @Override
    public boolean fingerprintsSame(Object currentFingerprint, String excludeSerialNo, String custNo) {
        return false;
    }

    @Override
    public void rulePremise(RulePremiseService rulePremiseService, RulePremiseVo rulePremiseVo, String... columnK) {}

    @Override
    public void rulePremiseV228(RulePremiseService rulePremiseService, RulePremiseVo rulePremiseVo) {

        if (!rulePremiseService.operationFlagV228(rulePremiseVo)) {
            return;
        }
        passToRisk(rulePremiseVo);
    }

    @Override
    public void passToRisk(RulePremiseVo rulePremiseVo) {
        RaiseLimitServiceImpl raiseLimitService = SpringUtils.getBean(RaiseLimitServiceImpl.class);
        raiseLimitService.replenishInfoPass(rulePremiseVo.getCustNo());
    }

}
